simetrix.DataGroup

class simetrix.DataGroup

Bases: object

Reference to a SIMetrix data group. For information see Accessing Simulation Data DataGroup objects provide access to data created by a SIMetrix or SIMPLIS simulation.

Examples

This example demonstrates some of the methods that return information about the DataGroup

import simetrix as sx

dataGroup =sx.currentGroup()

print(dataGroup.analysis, dataGroup.simulator)

opgroup = dataGroup.opgroup
if opgroup.valid :
    print("Group", dataGroup.name, "OP group=", opgroup.name)
else :
    print("Group", dataGroup.name, "has no OP group")

popgroup = dataGroup.popgroup
if popgroup.valid :
    print("Group", dataGroup.name, "POP group=", popgroup.name)
else :
    print("Group", dataGroup.name, "has no POP group")

This example gets a multi-division vector then prints the values from divisions 0 and 4

import simetrix as sx
import numpy as np

dataGroup =sx.currentGroup()

print(dataGroup.name)


vector = dataGroup.vectorOfName("vout")

if vector.valid :

    ## Get division 0 as numpy array
    print("Division 0")
    vout = np.array(vector)
    for v in vout :
        print(v)

    ## Get division 4 as numpy array
    print("\nDivision 4")
    vout = np.array(vector.y[4])
    for v in vout :
        print(v)

else :
    print("Cannot find vector")

See also

GroupVector

Methods

vectorOfName(name)

Returns a GroupVector of the given name.

vectors()

Returns a list of all vectors in the group.

Attributes

analysis

Returns the analysis type used to create the data group.

datafile

Returns full path of the primary datafile for the analysis.

name

Returns the name of the DataGroup.

opgroup

DataGroup object holding the operating point data associated with the simulation that created this group.

popgroup

DataGroup object holding associated Periodic operating point data.

simulator

Returns the simulator type that created the DataGroup.

title

The title of the group.

valid

Returns True if the DataGroup is valid, that is it exists in the SIMetrix environment.

property analysis: AnalysisType

Returns the analysis type used to create the data group.

property datafile: str

Returns full path of the primary datafile for the analysis.

property name: str

Returns the name of the DataGroup.

property opgroup: DataGroup

DataGroup object holding the operating point data associated with the simulation that created this group. For transient analyses, this is usually the same group as the t=0 values are the operating point values. For small signal analyses, there is usually a separate data group that holds the DC operating point values. Be aware that there isn’t always an operating point group available and in such cases this method can return an invalid group. Use the DataGroup.valid property to check validity.

property popgroup: DataGroup

DataGroup object holding associated Periodic operating point data. This is only valid for SIMPLIS AC and POP analyses.

property simulator: Simulator

Returns the simulator type that created the DataGroup.

property title: str

The title of the group. The DataGroup title string is obtained from the first line of the netlist. If generated from a schematic, this would usually be the full path of the schematic that created the netlist

property valid: bool

Returns True if the DataGroup is valid, that is it exists in the SIMetrix environment.

vectorOfName(name: str) GroupVector

Returns a GroupVector of the given name. If the vector does not exist, an invalid GroupVector will be returned. This can be tested with the GroupVector.valid property

vectors() list[GroupVector]

Returns a list of all vectors in the group.